using UnityEngine;

public class CameraShake : MonoBehaviour
{
    #region Singleton
    public static CameraShake instance;
    private Animator animator;

    void Start()
    {
        animator = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Animator>();
        if (instance == null) {
            instance = this;
        }
        else {
            Destroy(this.gameObject);
        }
    }

    #endregion

    public void Shake() {
        animator.SetTrigger("Shake");
    }
}
